<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">



<h:body>
    <h:form id="editCustomerDialogForm">
        <h:panelGrid columns="2" cellpadding="10">
            <h:outputLabel for="customer_name" value="Введите название заказчика"/>
            <p:inputText id="customer_name" value="#{customerBean.customer.name}" required="true"/>

            <h:outputLabel for="customer_full_name" value="Введите полное название заказчика"/>
            <p:inputText id="customer_full_name" value="#{customerBean.customer.fullName}" required="true"/>


            <h:outputText  value="Введите местоположение заказчика"/>
            <p:selectOneMenu value="#{customerBean.location.name}" effect="fold" editable="true">
                <f:selectItem itemLabel="Выберите метоположение" itemValue="" />
                <f:selectItems value="#{customerBean.locationList}" />
            </p:selectOneMenu>

            <h:outputLabel for="customer_address" value="Введите адрес заказчика"/>
            <p:inputText id="customer_address" value="#{customerBean.customer.address}" required="true"/>

            <h:outputLabel for="customer_description" value="Описание"/>
            <p:inputText id="customer_description" value="#{customerBean.customer.description}" required="true"/>

            <f:facet name="footer">
                <p:commandButton value="Сохранить" actionListener="#{customerBean.saveCustomer()}"
                                 oncomplete="handleEditCustomerRequest(xhr, status, args)"/>
                <p:commandButton value="Отмена" action="#{customerBean.closeEditDialog()}"
                        immediate="true"/>
            </f:facet>
        </h:panelGrid>
    </h:form>
</h:body>

</html>